package com.game.majiang.vo;

import java.util.ArrayList;

import javax.sql.rowset.CachedRowSet;

import com.game.server.db.SqlHelper;
import com.game.server.db.entity.GameTask;

public class GameTaskVo {

	public static ArrayList<GameTask> select() {
		ArrayList<GameTask> listTask = new ArrayList<>();
		String sql = "SELECT id,objecttype,timetype,tasktype,starttime,chixutime,`loop`,complete,opentask FROM gametask";
		CachedRowSet resultSet = SqlHelper.getResultSet(sql);
		try {
			while (resultSet.next()) {
				GameTask gt = new GameTask();
				gt.id = resultSet.getInt("id");
				gt.objecttype = resultSet.getInt("objecttype");
				gt.timetype = resultSet.getInt("timetype");
				gt.tasktype = resultSet.getInt("tasktype");
				gt.starttime = resultSet.getLong("starttime");
				gt.chixutime = resultSet.getLong("chixutime");
				gt.loop = resultSet.getInt("loop");
				gt.complete = resultSet.getLong("complete");
				gt.opentask = resultSet.getInt("opentask");
				listTask.add(gt);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return listTask;
	
	}
	
	
}
